home *** CD-ROM | disk | FTP | other *** search
/ SunSoft Catalyst CDWARE 1996 May to August / Catalyst CDWARE 1996 May to August.iso / .products / .bin / httpd / Solaris_2 / dtv < prev    next >
Text File  |  1995-12-09  |  2KB  |  65 lines

  1. #!./perl
  2. #change to perl after perl5 stuff is cleared up
  3.  
  4. #
  5. # This script will redirect the client to /channel/day or /channel/night
  6. # depending on the time of day (according to the server).
  7. #
  8.  
  9.  
  10. #require "ctime.pl";
  11. #
  12. # Play with these variables to meet your needs
  13. #
  14. $day_path = "";
  15. $night_path = "#night";
  16. $start_day = 7;       # Daytime starts at 7 am
  17. $start_night = 19;    # Nightime starts at 7 pm
  18.  
  19.  
  20. #
  21. # The code starts here
  22. #
  23. #@day = split (' ', &ctime(date) );
  24. @day = split (' ', `date` );
  25.  
  26.  
  27. #@today = split (' ', &ctime(time) );
  28. @today = split (' ', `time` );
  29.  
  30.  
  31. ($hour,$min,$sec) = split(':',$today[3]);
  32. if ($hour >= $start_night || $hour < $start_day) {
  33.     # Ok, we're in nightime
  34.     $redirpath = $night_path;
  35. }
  36. else {
  37. print $file;    # It's daytime
  38.     $redirpath = $day_path;
  39. }
  40.  
  41.  
  42. $file = "day$day[4].html";
  43.  
  44.     print "Content-type: text/html\n\n";
  45.     print "<html><head>\n";
  46.     print "<title>Disney Channel Program Guide</title>\n";
  47.     print "</head>\n";
  48.     print "<BODY BGCOLOR=\"#173D90\" text=\"#DDDDDD\" LINK=\"#EEEEEE\" VLINK=\"#EEEE22\"ALINK=\"#FF0000\">";
  49.     print "<h1>Programming Guide</h1><p>\n";
  50.     print "<a href=\"/cgi-bin/imagemap/disney/tdc/program_guide/main.map\"><img src=\"/disney/tdc/program_guide/images/dec$day[4].gif\" ISMAP></a>\n<p><P><P>";
  51.     print "</body>\n</html>";
  52. #open(OUT,">/opt/WWW/CERN/httpd/docs/program_guide/days/today.html");
  53. #open(DAY,"/opt/WWW/CERN/httpd/docs/program_guide/days/$file");
  54. #while (<DAY>) {
  55. #print OUT $_;
  56. #}
  57. #close(DAY);
  58. #close(OUT);
  59.  
  60.  
  61.  
  62.  
  63. #print "Location: http://snl.eng\n\n";
  64.  
  65.